package br.com.ozsolucoes.managedbean.base;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

public abstract class BaseManagedBean {

	protected void addMessageInfo(String summary) {
		FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, summary, null));
	}

	protected void addMessageWarn(String summary) {
		FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, summary, null));
	}

	protected void addMessageError(String summary) {
		FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, summary, null));
	}

	protected void addMessageFatal(String summary) {
		FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, summary, null));
	}

	public String paginaInicial() {
		return "home";
	}
	public String paginaLogin(){
		return "login";
	}
	public String meuPerfil(){
		return "perfil";
	}
	
}
